import java.util.Scanner;

public class Demo4_20 {
    //字符串的最后一个单词长度
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        //方法1：直接调用分割方法--split方法
        //String[] ss = str.split(" ");
        //int len = ss[ss.length - 1].length();
        //System.out.println(len);

        //方法2：lastIndexOf->substring截取字符串的长度
        int index = str.lastIndexOf(" ");
        String ret = str.substring(index + 1);
        System.out.println(ret.length());
    }
}
